package com.kadron.item;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.kadron.common.KSearch;
import com.kadron.entity.Color;
import com.kadron.entity.Material;
import com.kadron.entity.Size;

public class KItemListSearch implements KSearch {

	private Double priceFrom;
	private Double priceTo;
	private Long currencyId;
	private List<Color> colors = new ArrayList<Color>();
	private List<Size> sizes = new ArrayList<Size>();
	private List<Material> materials = new ArrayList<Material>();
	
	private Color color;
	private Size size;
	private Material material;
	
	private Date validTo;
	
	private boolean advanced;

	public KItemListSearch() {
		super();
	}

	public KItemListSearch(Long currencyId) {
		this();
		this.currencyId = currencyId;
	}

	public Double getPriceFrom() {
		return priceFrom;
	}

	public void setPriceFrom(Double priceFrom) {
		this.priceFrom = priceFrom;
	}

	public Double getPriceTo() {
		return priceTo;
	}

	public void setPriceTo(Double priceTo) {
		this.priceTo = priceTo;
	}

	public Long getCurrencyId() {
		return currencyId;
	}

	public void setCurrencyId(Long currencyId) {
		this.currencyId = currencyId;
	}

	public List<Color> getColors() {
		return colors;
	}

	public void setColors(List<Color> colors) {
		this.colors = colors;
	}

	public List<Size> getSizes() {
		return sizes;
	}

	public void setSizes(List<Size> sizes) {
		this.sizes = sizes;
	}

	public List<Material> getMaterials() {
		return materials;
	}

	public void setMaterials(List<Material> materials) {
		this.materials = materials;
	}

	public Date getValidTo() {
		return validTo;
	}

	public void setValidTo(Date validTo) {
		this.validTo = validTo;
	}

	public boolean isAdvanced() {
		return advanced;
	}

	public void setAdvanced(boolean advanced) {
		this.advanced = advanced;
	}
	
	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public Size getSize() {
		return size;
	}

	public void setSize(Size size) {
		this.size = size;
	}

	public Material getMaterial() {
		return material;
	}

	public void setMaterial(Material material) {
		this.material = material;
	}
	
	public void clearMany() {
		colors.clear();
		sizes.clear();
		materials.clear();
	}
	
	public void clearOne() {
		color = null;
		size = null;
		material = null;
	}
	
	public void clearAll() {
		priceFrom = null;
		priceTo = null;
		currencyId = null;
		validTo = null;
		clearMany();
		clearOne();
	}
	
	public void swith() {
		this.advanced = !advanced;
		clearMany();
		clearOne();
	}

}